package org.eden.rpc.common.entity;

import lombok.Data;
import org.eden.rpc.common.enumerate.ResponseCode;

import java.io.Serializable;

@Data
public class RpcResponse implements Serializable {

    private Integer statusCode;

    private String message;

    private Object data;

    public static RpcResponse success(Object result) {
        RpcResponse ret = new RpcResponse();
        ret.setMessage(ResponseCode.SUCCESS.getMsg());
        ret.setStatusCode(ResponseCode.SUCCESS.getCode());
        ret.setData(result);
        return ret;
    }

}
